package com.helloworld.fiberflax.inventory;

import com.helloworld.fiberflax.Fiberflax;
import com.helloworld.fiberflax.gui.GuiFiberflaxBag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
import net.minecraftforge.fml.common.network.NetworkRegistry;

public class GuiElementLoader implements IGuiHandler {
    public static final int GUIFiberflaxBag = 1;

    public GuiElementLoader() {
        NetworkRegistry.INSTANCE.registerGuiHandler(Fiberflax.instance, this);
    }

    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
        switch (ID) {
            case GUIFiberflaxBag:
                return new ContainerFiberflaxBag(player);
            default:
                return null;
        }
    }

    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
        switch (ID) {
            case GUIFiberflaxBag:
                return new GuiFiberflaxBag(new ContainerFiberflaxBag(player));
            default:
                return null;
        }
    }
}
